@use 'sass:color';

/**
 * 生成颜色调色板 这个函数根据基础颜色生成一个包含 10 个颜色等级的映射。
 * @param {string} $color - 基础颜色
 * @return {map} - 包含 10 个颜色等级的映射
 */
@function generate-palette($color) {
    @return (
        // '1': scale-color($color, $lightness: 95%, $saturation: -95%), // color.scale 已废弃
        '1': color.scale($color, $lightness: 95%, $saturation: -95%),
        '2': color.scale($color, $lightness: 85%, $saturation: -90%),
        '3': color.scale($color, $lightness: 75%, $saturation: -80%),
        '4': color.scale($color, $lightness: 65%, $saturation: -70%),
        '5': color.scale($color, $lightness: 40%, $saturation: -40%),
        '6': $color,
        '7': color.scale($color, $lightness: -10%, $saturation: -5%),
        '8': color.scale($color, $lightness: -25%, $saturation: -10%),
        '9': color.scale($color, $lightness: -40%, $saturation: -15%),
        '10': color.scale($color, $lightness: -60%, $saturation: -25%)
    )
}